package com.sgj.mvcframework.pojo;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/**
 * 存储封装属性
 * @author 沈国纪
 * @date 2021/12/17 23:47
 */
public class Handler {

	private Object controller;

	private Method method;

	private String url;

	/**
	 * 参数顺序，为了进行参数绑定，key 参数名， value 代表第几个参数
	 */
	private Map<String, Integer> paramIndexMapping;

	public Handler(Object controller, Method method, String url) {
		this.controller = controller;
		this.method = method;
		this.url = url;
		this.paramIndexMapping = new HashMap<>();
	}

	public Object getController() {
		return controller;
	}

	public Method getMethod() {
		return method;
	}

	public String getUrl() {
		return url;
	}

	public Map<String, Integer> getParamIndexMapping() {
		return paramIndexMapping;
	}
}